<%@ page import="org.bjou.ShiroUser" %>
<!doctype html>
<html>
	<head>
		<meta name="layout" content="pertho">
		<g:set var="entityName" value="${message(code: 'shiroUser.label', default: 'ShiroUser')}" />
		<title><g:message code="default.edit.label" args="[entityName]" /></title>
	</head>
	<body>
		<div class="container">
    <div class="row">
      <div class="twelve columns">
        <div class="box_c">
          <div class="box_c_heading cf">
            <p><g:message code="default.edit.label" args="[entityName]" /></p>
          </div>
          <div class="box_c_content">
            
            
		<div id="edit-shiroUser" class="content scaffold-edit" role="main">
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${shiroUserInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${shiroUserInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form method="post" >
				<g:hiddenField name="id" value="${shiroUserInstance?.id}" />
				<g:hiddenField name="version" value="${shiroUserInstance?.version}" />
				<fieldset class="form">
					
<div class="fieldcontain ${hasErrors(bean: shiroUserInstance, field: 'username', 'error')} required">
	<label for="username">
		<g:message code="shiroUser.username.label" default="Username" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="username" required="" value="${shiroUserInstance?.username}"/>
</div>




<div class="fieldcontain ${hasErrors(bean: shiroUserInstance, field: 'roles', 'error')} ">
	<label for="roles">
		<g:message code="shiroUser.roles.label" default="Roles" />
		
	</label>
  <g:select name="roles" from="${org.bjou.ShiroRole.list()}"   optionKey="id" optionValue="name" 
                 size="10"  value="${shiroUserInstance?.roles*.id}" />
	
</div>
                                  
  <g:if test="${roleInstance?.name=="系部角色"}">                                
  <div class="fieldcontain ">
	<label for="roles">
		所属系部
		
	</label>
  <g:select name="departmentId" from="${org.bjou.Department.list()}"   optionKey="id" optionValue="departmentName" 
         noSelection="['': '请选择']"        value="${departmentInstance?.id}" />
	
</div>  
  </g:if>
                                  
                                  
  <g:if test="${roleInstance?.name=="分校角色"}">                                
  <div class="fieldcontain ">
	<label for="roles">
		所属分校
		
	</label>
  <g:select name="branchId" from="${org.bjou.Branch.list()}"   optionKey="id" optionValue="branchName" 
               noSelection="['': '请选择']"   value="${branchInstance?.id}" />
	
</div>  
  </g:if>
                                  
                                  

				</fieldset>
				<fieldset class="buttons">
					<g:actionSubmit class="gh_button" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" />
					<g:actionSubmit class="gh_button icon danger" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" formnovalidate="" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" />
                                        <g:link class="gh_button list" action="list">返回列表</g:link>
                                </fieldset>
			 </g:form>
              <!-- end -->
            </div>
          </div>
        </div>
      </div>
    </div>
	</body>
</html>
